/**
 * 
 */
package com.hector.meinewerk.model;

import java.util.ArrayList;

import com.hector.meinewerk.lib.json.me.JSONObject;

public class Category {
	private String id;
	private String name;
	private String moduleName;
	private String dateCreate;
	private String parentId;
	private int order;
	private String avatar;
	private ArrayList<Product> products;
	private ArrayList<Category> childCategories;

	public Category(){
		
	}
	
	public static Category parseJson(JSONObject jsonCategory){
		Category category = new Category();
		try {
			category.setId(jsonCategory.getString("id"));
			category.setName(jsonCategory.getString("name"));
			category.setModuleName(jsonCategory.getString("module_name"));
			category.setDateCreate(jsonCategory.getString("date_create"));
			category.setParentId(jsonCategory.getString("parent_id"));
			category.setOrder(jsonCategory.getInt("order"));
			category.setAvatar(jsonCategory.getString("avatar"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return category;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getModuleName() {
		return moduleName;
	}
	public void setModuleName(String moduleName) {
		this.moduleName = moduleName;
	}
	public String getDateCreate() {
		return dateCreate;
	}
	public void setDateCreate(String dateCreate) {
		this.dateCreate = dateCreate;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public int getOrder() {
		return order;
	}
	public void setOrder(int order) {
		this.order = order;
	}
	public String getAvatar() {
		return avatar;
	}
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public ArrayList<Product> getProducts() {
		return products;
	}

	public void setProducts(ArrayList<Product> products) {
		this.products = products;
	}

	public ArrayList<Category> getChildCategories() {
		return childCategories;
	}

	public void setChildCategories(ArrayList<Category> categories) {
		this.childCategories = categories;
	}
}
